﻿#pragma once

#include "Render/FrameBuffer.h"

class CORE_API FrameBufferStack
{
public:
  void Push(const Ref<FrameBuffer> &fb);
  Ref<FrameBuffer> Pop();
  Ref<FrameBuffer> Peek();

  bool IsEmpty() const;
  size_t GetSize() const;

  void SetKeepIntermediateTextures(bool keep);
  void ClearIntermediateTexturesReferences();
  std::vector<Ref<Texture>> GetIntermediateTextures();

private:
  std::vector<Ref<FrameBuffer>> m_stack;
  std::vector<Ref<Texture>> m_intermediateTextures;
  bool m_keepIntermediateTextures = false;
};